std::basic_string::c_str

From Cppreference

Jump to: navigation, search
const CharT* c_str() const;

Returns pointer to a null-terminated character array with data equivalent to those stored in the string. Specifically the pointer is such that range [data(); data() + size()) is a valid.

Contents

Parameters

(none)

Return value

pointer to the a null-terminated character string with the data of the string.

Complexity

constant.

See also

front (C++0x)
accesses the first character
(public member function)
back (C++0x)
accesses the last character
(public member function)
data
returns a pointer to the first character of a string
(public member function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages